<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<div class="table-scrollable">
	<div class="order-nav">
		<a onclick="searchStatus('all')" style="font-size: 16px;">全部列表</a> <a
			onclick="searchStatus('Pending')"
			style="font-size: 16px; margin-left: 10px;">未付款</a> <a
			onclick="searchStatus('Unshipped')"
			style="font-size: 16px; margin-left: 10px;">待发货</a><a
			onclick="searchStatus('Shipped')"
			style="font-size: 16px; margin-left: 10px;">已发货</a><a
			onclick="searchStatus('Canceled')"
			style="font-size: 16px; margin-left: 10px;">已取消</a>
	</div>
	<h1>没有查询到符合条件的结果</h1>
</div>
<input id="startD" value="${startDate}" style="visibility: hidden;" />
<input id="endD" value="${endDate}" style="visibility: hidden;" />



<div class="modal fade" id="menuModal" tabindex="-1" role="basic"
	aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-hidden="true"></button>
				<h4 class="modal-title">手工发货</h4>
			</div>
			<div class="modal-body">

				<div style="margin: 0 auto; padding: 3% 3% 3% 5%;">

					<label>订单号&nbsp;</label><span id="orderid"
						style="color: #FF7F00; margin-left: 24px;"></span><br> <label>发货仓库&nbsp;</label><select
						style="margin-left: 10px; width: 200px;"><option>默认仓库</option></select><br>
					<label>快递公司&nbsp;</label><input type="text" placeholder="Fedex"
						style="width: 200px; margin-left: 10px;" /><br> <label>快递单号&nbsp;</label><input
						type="text" style="width: 200px; margin-left: 10px;" />
				</div>

			</div>
			<div class="modal-footer">
				<button type="button" class="btn blue" onclick="saveParentMenu()">确定</button>
				<button type="button" class="btn default" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
</div>
<style type="text/css">
.order-nav {
	padding: 2% 2% 2% 0%;
}

.order-nav span {
	margin-left: 30px;
	font-size: 16px;
}

.order-nav span.active {
	color: #4F94CD;
}
</style>
<script type="text/javascript">
	function searchStatus(status) {

		var startDate = $("#startDate").val();
		var endDate = $("#endDate").val();

		if (startDate == "" || endDate == "") {

			startDate = $("#startD").val();
			endDate = $("#endD").val();
			
		}

		$.ajax({
			type : 'post',
			url : webRoot + '/webpage/shopping/Amazon/jdt.jsp',
			dataType : 'html',
			success : function(data) {
				$(".panel-content").html(data);
			}
		});

		$.ajax({
			type : 'post',
			url : webRoot + '/amazonorderslists/list',
			data : {
				'start' : startDate,
				'end' : endDate,
				'status' : status
			},
			success : function(data) {

				$(".panel-content").html(data);

			}
		})

	}

	$(function() {

		$(".order-nav span").click(function() {
			$(this).toggleClass('active');
		})

		$("#slec").blur(function() {
			getOption()
		});

	});

	function getOption() {

		var selectText = $("#slec").find("option:selected").text();
		var selectValue = $("#slec").find("option:selected").val();
		if (selectText == '手工发货') {
			$("#orderid").html(selectValue);
			$('#menuModal').modal('show');
		}

	}

	function toDetails(orderid) {
		$.ajax({
			type : 'post',
			url : webRoot + '/amazonorderslists/orderDetails',
			data : {
				"orderid" : orderid
			},
			dataType : 'html',
			success : function(data) {
				$(".panel-search").hide();
				$(".panel-content").html(data);
			}
		});
	}

	function pageControl(pageNo) {
		var url = '/amazonorderslists/nextPage'
		if (url.indexOf('?') > -1) {
			url += '&pageNo=' + pageNo;
		} else {
			url += '?pageNo=' + pageNo;
		}
		$.ajax({
			type : 'post',
			url : webRoot + url,
			dataType : 'html',
			success : function(data) {
				$(".panel-content").html(data);
			}
		});
	}
</script>